package com.example.ploy4j.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
public class GitRepositoryConfigDto {

    private Long id;

    @NotBlank(message = "项目名称不能为空")
    @Size(max = 100, message = "项目名称长度不能超过100个字符")
    private String projectName;

    @NotBlank(message = "仓库URL不能为空")
    @Size(max = 500, message = "仓库URL长度不能超过500个字符")
    private String repositoryUrl;

    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) // Token也只在写入时处理
    @Size(max = 255, message = "Gitee Token长度建议不超过255个字符")
    private String giteeToken;

    @NotBlank(message = "默认分支不能为空")
    @Size(max = 100, message = "默认分支长度不能超过100个字符")
    private String defaultBranch;

    private String servserHost;

    private LocalDateTime createdAt;

    private LocalDateTime updatedAt;

    private LocalDateTime lastSuccessfulDeploymentAt;
} 